package pool;

/**
 * @author ex_chenzy59
 * @since 2025/4/11
 * 池对象工厂
 */
public abstract class PoolObjectFactory<T> {
    /*创建对象*/
    public PoolObject<T> makeObject() {
        return null;
    }
    /*借出对象时激活对象*/
    public void activateObject(PoolObject<T> item){

    }
    /*对象归还到池中时调用*/
    public void passivateObject(PoolObject<T> item) throws Exception {

    }
    /*销毁对象时调用*/
    public void destroyObject(PoolObject<T> item) {

    }
    /*验证对象有效性,testWhileIdle=true时会调用*/
    public abstract boolean validateObject(PoolObject<T> item);
}
